/*module.exports= {
  lintOnSave: false,
  devServer: {
    port: 8040,
    proxy: {
      '/api': {
       target: 'http://localhost:8803/api',
       changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
       },
      '/bup': {
        target: 'http://localhost:8804/api/',
        changeOrigin: true,
        pathRewrite: {
          '^/bup': ''
        }
      },
      '/iserver': {
        target: 'http://localhost:8090/',
        changeOrigin: true,
        pathRewrite: {
          '^/iserver': ''
        }
      },
      '/back': {
        target: 'http://localhost:8805/api',
        changeOrigin: true,
        pathRewrite: {
          '^/back': ''
        }
      }
    },
  },
  publicPath: process.env.NODE_ENV === 'production' ? './' : '/'
}*/
const timeStamp = new Date().getTime()
module.exports= {
  lintOnSave: false,

  devServer: {
    port: 8081,
    proxy: {
      '/api': {
        //target: 'http://192.169.77.11:8802/result-integration-server/api',
       target: 'http://localhost:8802/result-integration-server/api',
        // target: 'http://10.16.11.240:15479/result-integration-server/api',

        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      },
      '/bup': {
        //target: 'http://192.169.77.11:8802/database-handle-server/api',
        target: 'http://localhost:8802/database-handle-server/api',
        changeOrigin: true,
        pathRewrite: {
          '^/bup': ''
        }
      },
      '/iserver': {
        //target: 'http://172.31.0.54:8090/iserver/',
      //  target: 'https://10.226.77.11/iserver/',
      target: 'http://localhost:8090/iserver/',
        changeOrigin: true,
        pathRewrite: {
          '^/iserver': ''
        }
      },
      '/back': {
        //target: 'http://172.31.0.54:8802/manage-server/api',
        target: 'http://localhost:8802/manage-server/api',
        pathRewrite: {
          '^/back': ''
        }
      },
      '/wwcw': {
        //target: 'http://172.31.0.54:8802/manage-server/api',
        target: 'http://www.pm25.in/api',
        changeOrigin: true,
        pathRewrite: {
          '^/wwcw': ''
        }
      },
      '/phone': {
        //target: 'http://172.31.0.54:8802/manage-server/api',
        target: 'http://10.226.77.12:10060/sms/api/',
        changeOrigin: true,
        pathRewrite: {
          '^/phone': ''
        }
      },
     /* '/tdt': {
        //target: 'http://172.31.0.54:8802/manage-server/api',
        target: 'http://api.tianditu.gov.cn',
        changeOrigin: true,
        pathRewrite: {
          '^/tdt': ''
        }
      }*/
    },
  },
  configureWebpack: { // 重点
    // 输出重构 打包编译后的js文件名称,添加时间戳.
    output: {
      filename: `js/[name].${timeStamp}.js`,
      chunkFilename: `js/chunk.[id].${timeStamp}.js`,
    }
  },
  css: { //重点.
    extract: { // 打包后css文件名称添加时间戳
      filename: `css/[name].${timeStamp}.css`,
      chunkFilename: `css/chunk.[id].${timeStamp}.css`,
    }
  },
  publicPath: process.env.NODE_ENV === 'production' ? './' : './'
}
